<template>
    <div id="Footer">
    <div id="PoweredBy">
      &nbsp;<a href="http://www.csu.edu.cn" target="_blank">http://www.csu.edu.cn</a>
    </div>

    <div id="Banner">
      <!-- 登录用户的 banner -->
      <img :src="bannerImage" alt="Banner Image" />
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue'
// import bannerMain from '../assets/images/banner_main.PNG'
// import welcomeImg from '../assets/images/welcomeImg.PNG'
const bannerMain = new URL('../assets/images/banner_main.PNG', import.meta.url).href
const welcomeImg = new URL('../assets/images/welcomeImg.PNG', import.meta.url).href



// 通过 prop 传入登录账户信息
const props = defineProps({
  loginAccount: {
    type: Object,
    default: null
  }
})

// 计算 banner 显示图片
const bannerImage = computed(() => {
  if (props.loginAccount && props.loginAccount.bannerOption === 1) {
    return bannerMain
  } else {
    return welcomeImg
  }
})
</script>
<style scoped></style>